<template>
  <div class="mys">
    <div class="avatar-Info">
      <div class="avatar"></div>
      <div class="Info">用户名</div>
    </div>
    <div class="content">
      <div>
        <van-icon name="clock-o" class="ico" /><br />
        历史记录
      </div>
      <div>
        <router-link class="un" to="collect"><van-icon name="bookmark-o" class="ico" /> <br />我的收藏</router-link>
      </div>
      <div>
        <router-link class="un" to="like"><van-icon name="good-job-o" class="ico" /> <br />我的点赞</router-link>
      </div>
    </div>
    <div class="selec">
      <van-cell title="推荐分享  &gt;" @click="showShare = true" />
      <van-cell title="意见反馈  &gt;" />
      <van-cell title="关于我们  &gt;" />
      <van-cell title="退出登录  &gt;" />
      <van-share-sheet v-model="showShare" title="立即分享给好友" :options="options" @select="onSelect" />
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  name: 'Index-my',
  data() {
    return {
      username: '',
      showShare: false,
      options: [
        { name: '微信', icon: 'wechat' },
        { name: '微博', icon: 'weibo' },
        { name: '复制链接', icon: 'link' },
        { name: '分享海报', icon: 'poster' },
        { name: '二维码', icon: 'qrcode' },
      ],
    }
  },
  created() {
    // localStorage.getItem('username')
  },
  methods: {
    onSelect(option) {
      Toast(option.name)
      this.showShare = false
    },
  },
}
</script>

<style lang="less" scoped>
.mys {
  background-color: #f5f5f5;

  padding: 20px 10px 0 10px;
}
.avatar-Info {
  display: flex;
  // justify-content: center;
  align-items: center;
  .avatar {
    width: 80px;
    height: 80px;
    background-image: url('../assets/image.png');
    background-size: contain;
    margin-right: 30px;
  }
}
.content {
  margin-top: 30px;
  display: flex;
  width: 100%;
  background-color: #fff;
  height: 86px;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 30px;
}
.un,
.un:link,
.un:visited,
.un:hover,
.un:active {
  text-decoration: none;
  color: inherit;
}
.ico {
  padding-left: 17px;
  font-size: 30px;
  margin-bottom: 5px;
}
</style>
